<template>
	<view>
		<uni-section title="单选框" type="line" padding>
			<uni-data-checkbox @change="changeCheck" v-model="danxuan" :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="多选" type="line" padding>
			<uni-data-checkbox @change="duoxuanChange" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="最小多选" type="line" padding>
			<uni-data-checkbox @change="duoxuanChange" min="1" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="最大多选" type="line" padding>
			<uni-data-checkbox @change="duoxuanChange" max="2" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="选择数量" type="line" padding>
			<uni-data-checkbox @change="duoxuanChange" min="1" max="2" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="mode button" type="line" padding>
			<uni-data-checkbox mode="button" @change="changeCheck" v-model="danxuan" :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="mode list" type="line" padding>
			<uni-data-checkbox mode="list" @change="changeCheck" v-model="danxuan" :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="mode tag" type="line" padding>
			<uni-data-checkbox mode="tag" @change="changeCheck" v-model="danxuan" :localdata="sex"></uni-data-checkbox>
		</uni-section>
		<uni-section title="mode tag" type="line" padding>
			<uni-data-checkbox mode="tag" @change="duoxuanChange" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		<uni-section title="多选" type="line" padding>
		</uni-section>
			<uni-data-checkbox wrap @change="duoxuanChange" v-model="duoxuan" multiple :localdata="sex"></uni-data-checkbox>
		</uni-section>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				danxuan:0,
				duoxuan:[0],
				sex: [{
					text: '男',
					value: 0
				}, {
					text: '女',
					value: 1
				}, {
					text: '未知',
					value: 2,
					disable:true
				}],
			}
		},
		methods: {
			changeCheck(e){
				this.danxuan = e.detail.value
				
			},
			duoxuanChange(e){
				this.duoxuan = e.detail.value
				console.log('多选',e.detail)
			}
		}
	}
</script>

<style>

</style>
